const state = {
  displayDialog: false,
  dialogMessage: ''
}

const mutations = {
  SHOW_DISPLAY_DIALOG (state, message) {
    state.displayDialog = true
    state.dialogMessage = message
  },
  HIDE_DISPLAY_DIALOG (state) {
    state.displayDialog = false
    state.dialogMessage = ''
  }
}

const getters = {
  dialogStatus: state => {
    return state.displayDialog
  },
  dialogMessage: state => {
    return state.dialogMessage
  }
}

const actions = {
  showDialog ({ commit }, message) {
    commit('SHOW_DISPLAY_DIALOG', message)
  },
  hideDialog ({commit}) {
    commit('HIDE_DISPLAY_DIALOG')
  }
}

export default {
  state,
  mutations,
  actions,
  getters
}
